package shiyan1;

import java.util.Scanner;

class Person {
	private String name;
	private int age;
	private boolean gender;// true：男 false：女
	private int id;

	
public Person() {
		System.out.println("This is constructor");
		System.out.printf("%d,%d,%s,%d%n",name,age,gender,id);
	}
	
	
public Person(String name,int age,boolean gender){
		this.name =name;
		this.age=age;
		this.gender=gender;
	}
public void setName(String name){
		this.name =name;
	}
	
public String getName(){
		return name;
	}
@Override
public String toString() {
	return "Person [name=" + name + ", age=" + age + ", gender=" + gender + ", id=" + id + "]";
}
}	
public class Main {

public static void main(String[] args) {
		// TODO Auto-generated method stub
	Scanner in = new Scanner(System.in);
	int n=in.nextInt();
	Person[] p=new Person[n];
	for(int i=0;i<p.length;i++)
	{
		Person person=new Person(in.next(),in.nextInt(),in.nextBoolean());
		p[i]=person;
	}
	for(int i=p.length-1;i>=0;i--)
	{
		System.out.println(p[i].toString());
	}
	Person per = new Person();
	System.out.println(per.toString());
	
}

}
